/**
 * 会员相关API
 */
import request, {
  Method
} from '@/utils/request'
import md5Libs from "@/libs/function/md5";

/**
 * 银行账户列表
 */
export function getWithdrawalApplyBanks(params) {
  return request.ajax({
    url: `/mall/member/withdrawalApply/banks`,
    method: Method.GET,
    needToken: true,
    params
  })
}

/**
 * 设置默认银行账户
 */
export function putWithdrawalApplyDefaultBank(params) {
  return request.ajax({
    url: `/mall/member/withdrawalApply/defaultBank`,
    method: Method.PUT,
    needToken: true,
    loading: true,
    isJson: true,
    params: params
  })
}

/**
 * 查询仓位
 */
export function getMallPosition(params) {
  return request.ajax({
    url: `/mall/member/position/`,
    method: Method.GET,
    needToken: true,
    params
  })
}
/**
 * 汇购列表
 */
export function getMallPositionBets(params) {
  return request.ajax({
    url: `/mall/member/position/bets`,
    method: Method.GET,
    needToken: true,
    params
  })
}
/**
 * 查询仓期
 */
export function getMallPositionPeriods(params) {
  return request.ajax({
    url: `/mall/member/position/periods`,
    method: Method.GET,
    needToken: true,
    params
  })
}

/**
 * 汇购
 */
export function putMallPosition(data, params) {
  return request.ajax({
    url: `/mall/member/position/`,
    method: Method.PUT,
    needToken: true,
    loading: true,
    isJson: true,
    data,
    params,
  })
}

/**
 * 汇购预排
 */
export function putMallPreBet(params) {
  return request.ajax({
    url: `/mall/member/preBet`,
    method: Method.PUT,
    needToken: true,
    loading: true,
    isJson: true,
    params,
  })
}
/**
 * 百汇券转汇购券
 */
export function putMallD2g(params) {
  return request.ajax({
    url: `/mall/member/d2g`,
    method: Method.PUT,
    needToken: true,
    loading: true,
    isJson: true,
    params,
  })
}
/**
 * 百汇券转黄金券
 */
export function putMallH2g(params) {
  return request.ajax({
    url: `/mall/member/h2g`,
    method: Method.PUT,
    needToken: true,
    loading: true,
    isJson: true,
    params,
  })
}
/**
 * 查看白名单
 */
export function getMemberWl(params) {
  return request.ajax({
    url: `/mall/member/wl`,
    method: Method.GET,
    needToken: true,
    params
  })
}

/**
 * 切换白名单会员
 */
export function getMemberWlCheckIn(params) {
  return request.ajax({
    url: `/mall/member/wlCheckIn`,
    method: Method.GET,
    needToken: true,
    params
  })
}
/**
 * 添加白名单
 */
export function putMemberWladd(params) {
  return request.ajax({
    url: `/mall/member/wladd`,
    method: Method.PUT,
    needToken: true,
    loading: true,
    isJson: true,
    params,
  })
}
/**
 * 删除白名单
 */
export function deleteMemberWldel(params) {
  return request.ajax({
    url: `/mall/member/wldel`,
    method: Method.DELETE,
    needToken: true,
    loading: true,
    isJson: true,
    params,
  })
}

// 切换白名单会员
export function getMemberPositionSum(params) {
  return request.ajax({
    url: `/mall/member/position/sum`,
    method: Method.GET,
    needToken: true,
    params
  })
}


// 查询抽奖活动
export function getCrazyAnnouncement(params) {
  return request.ajax({
    url: `/mall/member/crazy/announcement`,
    method: Method.GET,
    needToken: true,
    params
  })
}

/**
 * 购买彩蛋
 */
export function putCrazyBuy(params) {
  return request.ajax({
    url: `/mall/member/crazy/buy`,
    method: Method.PUT,
    needToken: true,
    loading: true,
    isJson: true,
    params,
  })
}


// 查询彩蛋
export function getCrazyEgg(params) {
  return request.ajax({
    url: `/mall/member/crazy/egg`,
    method: Method.GET,
    needToken: true,
    params
  })
}

/**
 * 投入奖池
 */
export function putCrazyInPools(params) {
  return request.ajax({
    url: `/mall/member/crazy/inPools`,
    method: Method.PUT,
    needToken: true,
    loading: true,
    isJson: true,
    params,
  })
}

// 查询我的彩蛋和五色积分
export function getCrazyInfo(params) {
  return request.ajax({
    url: `/mall/member/crazy/info`,
    method: Method.GET,
    needToken: true,
    params
  })
}

// 查询购买的彩蛋
export function getCrazyMyEggs(params) {
  return request.ajax({
    url: `/mall/member/crazy/myEggs`,
    method: Method.GET,
    needToken: true,
    params
  })
}
// 查询活动
export function getCrazyActivities(params) {
  return request.ajax({
    url: `/mall/member/crazy/activities`,
    method: Method.GET,
    needToken: true,
    params
  })
}
// 今天是否完成
export function getCrazyCheck(id) {
  return request.ajax({
    url: `/mall/member/crazy/check/${id}`,
    method: Method.GET,
    needToken: true,
  })
}
/**
 * 完成视频观看
 */
export function putCrazyDone(id) {
  return request.ajax({
    url: `/mall/member/crazy/done/${id}`,
    method: Method.PUT,
    needToken: true,
    loading: true,
  })
}
// 疯狂积分
export function getCrazyPoints(params) {
  return request.ajax({
    url: `/mall/member/crazy/points`,
    method: Method.GET,
    needToken: true,
    params,
  })
}
// 疯狂奖池
export function getCrazyPools(params) {
  return request.ajax({
    url: `/mall/member/crazy/pools`,
    method: Method.GET,
    needToken: true,
    params,
  })
}
/**
 * 积分转让
 */
export function putCrazyTransferP(params) {
  return request.ajax({
    url: `/mall/member/crazy/transferP`,
    method: Method.PUT,
    needToken: true,
    loading: true,
    params,
  })
}